﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Tic1a00
    {
        private int? _subid;
		private string _appid;
		private string _subcode;
		private string _subname;
        private int? _subtype;
		private string _subtypedesc;
        private DateTime? _subcreatetime;
        private int? _substatue;
		private string _substatusdesc;
		private string _usercode;
		
        /// <summary>
        /// 主键ID
        /// </summary>
		public int? Subid
		{
			get { return _subid;	 }
			set { _subid=value;	}
		}
        /// <summary>
        /// 公司
        /// </summary>
		public string Appid
		{
			get { return _appid;	 }
			set { _appid=value;	}
		}
        /// <summary>
        /// 项目代码
        /// </summary>
		public string Subcode
		{
			get { return _subcode;	 }
			set { _subcode=value;	}
		}
        /// <summary>
        /// 项目名称
        /// </summary>
		public string Subname
		{
			get { return _subname;	 }
			set { _subname=value;	}
		}
        /// <summary>
        /// 往来类型
        /// </summary>
		public int? Subtype
		{
			get { return _subtype;	 }
			set { _subtype=value;	}
		}
        /// <summary>
        /// 类型名称
        /// </summary>
		public string Subtypedesc
		{
			get { return _subtypedesc;	 }
			set { _subtypedesc=value;	}
		}
        /// <summary>
        /// 创建日期
        /// </summary>
		public DateTime? Subcreatetime
		{
			get { return _subcreatetime;	 }
			set { _subcreatetime=value;	}
		}
        /// <summary>
        /// 状态
        /// </summary>
		public int? Substatue
		{
			get { return _substatue;	 }
			set { _substatue=value;	}
		}
        /// <summary>
        /// 状态名称
        /// </summary>
		public string Substatusdesc
		{
			get { return _substatusdesc;	 }
			set { _substatusdesc=value;	}
		}
        /// <summary>
        /// 用户
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
		
		public static List<Tic1a00> GetTic1a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Tic1a00> list = new List<Tic1a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Tic1a00 model = GetTic1a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Tic1a00 GetTic1a00ByDataRow(DataRow dr)
		{
			Tic1a00 model = new Tic1a00(); //实例化Tic1a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("subid")&&!(dr["subid"] is System.DBNull))  
				model.Subid = ( int)dr["subid"];
			if (dcc.Contains("appid")&&!(dr["appid"] is System.DBNull))  
				model.Appid = ( string)dr["appid"];
			if (dcc.Contains("subcode")&&!(dr["subcode"] is System.DBNull))  
				model.Subcode = ( string)dr["subcode"];
			if (dcc.Contains("subname")&&!(dr["subname"] is System.DBNull))  
				model.Subname = ( string)dr["subname"];
			if (dcc.Contains("subtype")&&!(dr["subtype"] is System.DBNull))  
				model.Subtype = ( int)dr["subtype"];
			if (dcc.Contains("subtypedesc")&&!(dr["subtypedesc"] is System.DBNull))  
				model.Subtypedesc = ( string)dr["subtypedesc"];
			if (dcc.Contains("subcreatetime")&&!(dr["subcreatetime"] is System.DBNull))  
				model.Subcreatetime = ( DateTime)dr["subcreatetime"];
			if (dcc.Contains("substatue")&&!(dr["substatue"] is System.DBNull))  
				model.Substatue = ( int)dr["substatue"];
			if (dcc.Contains("substatusdesc")&&!(dr["substatusdesc"] is System.DBNull))  
				model.Substatusdesc = ( string)dr["substatusdesc"];
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			
			return model;
		}
    }
}
